#pragma config(I2C_Usage, I2C1, i2cSensors)
#pragma config(Sensor, I2C_1,  lights,         sensorQuadEncoderOnI2CPort,    , AutoAssign)
#pragma config(Sensor, I2C_2,  line,           sensorQuadEncoderOnI2CPort,    , AutoAssign)
#pragma config(Motor,  port2,           left,          tmotorVex269, openLoop)
#pragma config(Motor,  port4,           right,         tmotorVex269, openLoop)
#pragma config(Motor,  port5,           arm,           tmotorVex269, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

bool checklight()
{
  if (SensorValue(lights) > 200 )
  {
    return true;
  }
  return false;
}

task main ()
{

  bool light = checklight();

  while (light)
  {
    motor[left] = 65;
    motor[right] = 127;
    wait1Msec(1000);
  }

}
